package client;

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextPane;

public class clientView extends JFrame{

	private static final long serialVersionUID = 1L;
	public clientClass client;
	public JTextPane insertText;
	public JTextPane  messageText;
	public JButton	  valideButton;
	
	public clientView(clientClass c, clientApp app){
		super("Messagerie");
		
		client= c;
		
		JPanel panel1= new JPanel(new BorderLayout());
		messageText= new JTextPane();
		messageText.setEditable(false);
		messageText.setText("Bienvenue");
		panel1.add(messageText, BorderLayout.NORTH);
		
		JPanel panel2= new JPanel(new GridLayout(2,1));
		insertText = new JTextPane();
		valideButton = new JButton("Valider");
		panel2.add(insertText);
		panel2.add(valideButton);
		panel1.add(panel2, BorderLayout.SOUTH);
		valideButton.addActionListener(app);
		this.add(panel1);
		
		this.addWindowListener(app);
	}

}
